<template>
	<view>
	    <view class="search-box">
		    <uni-search-bar  @input="input" :radius="100" placeholder="请输入关键词" cancelButton="none" ></uni-search-bar>	
	    </view>
	</view>
</template>
<script>
	export default {
		data() {
			return {
				// 给搜索框做防抖处理
				timer:null,
				kw:'',
			};
		},
		methods:{
			// input输入事件的处理函数
			input(e){
				clearTimeout(this.timer)
				this.timer = setTimeout(()=>{
				this.kw = e;
				},500);
			},

		}
	}
</script>

<style lang="scss">
	// 搜索框的吸顶效果
.search-box{
	position: sticky;
	top:0;
	z-index:999;
}
</style>
